package org.example;

import java.io.File;

import HttpUtils.FileUtils;
import wh.coach.utils.HttpReadUtils;

public class test13 {
    public static void main(String[] args) throws Exception {
        String url = "https://test.home.tabledi.com/api/overview/";
        File file = new File(System.getProperty("user.home"), "/my_java_test/test3.txt");
//
//        final BytesWrapper bytesWrapper = HttpReadUtils.readUrlAsBytes(url);
//        FileUtils.writeToFile(file, true, bytesWrapper.getData());

        HttpReadUtils.readUrl("https://test.home.tabledi.com/api/overview/", (mineType, inputStream) -> {
            FileUtils.writeToFile(file, true, inputStream);
        });

//        int bufferSize = 50;
//        HttpWrite.BufferControl bufferControl = new HttpWrite.FixedBuffer(bufferSize);
//
//        //调用方法读取url
//        HttpReadUtils.readUrlAsBytes(url);
//        System.out.println("-----------");
//
//        //调用方法存储url内容
//        HttpWrite.sendHttpRequest(url, folder, path, bufferControl);
//
//        // 等待请求执行完成
//        Thread.sleep(500);
//
//        // 进程结束
//        System.exit(0);

    }
}
//为什么我的进程没有结束

